Grid4 - Alternative Method

A = (4.0983753475148275, 3.1974032204396643)
B = (4.491316000046813, 3.352198022952265)
d_{AB} = Distance(A, B)
θ: atan(Slope[Line[A, B]])
a = Line(A, B)
m = 4 (slider from 0 to 10, step 1)
n = 3 (slider from 0 to 10, step 1)
b = OrthogonalLine(A, a)
GridParallelABpos = Sequence(Sequence[(x(A) + j * d_{AB} * cos(θ) - i * d_{AB} * sin(θ), y(A) + j * d_{AB} * sin(θ) + i * d_{AB} * cos(θ)), i, -m, m], j, -n, n, 2 * n)
GridPerpABpos = Sequence(Sequence[(x(A) - i * d_{AB} * sin(θ) + j * d_{AB} * cos(θ), y(A) + i * d_{AB} * cos(θ) + j * d_{AB} * sin(θ)), j, -n, n], i, -m, m, 2 * m)